package top.purity.server.user.domain;

import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Comment;
import top.purity.framework.orm.BaseTenantDO;

/**
 * @Author lmh
 * @Description
 * @CreateTime 2023-09-25 15:38
 */

@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "user_account_role_rel", uniqueConstraints = {
        @UniqueConstraint(columnNames = {"account_id", "role_id", "tenant_id"})
}, indexes = {
        @Index(name = "idx_ai", columnList = "account_id"),
        @Index(name = "idx_ri", columnList = "role_id")
})
public class UserRole extends BaseTenantDO {
    @Column(name = "account_id", nullable = false)
    @Comment("账号id")
    private Long accountId;
    @Column(name = "role_id", nullable = false)
    @Comment("角色id")
    private Long roleId;

}
